<%-- 
    Document   : ListFood
    Created on : Apr 28, 2012, 9:01:21 PM
    Author     : Luong
--%>

<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<script type="text/javascript" src="paging/jquery-1-3-2.js"></script>
<script type="text/javascript" src="paging/tablesorter.js"></script>
<script type="text/javascript" src="paging/tablesorter_filter.js"></script>
<script type="text/javascript" src="paging/jquery.tablesorter.pager.js"></script>
<%@taglib  uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Tunga Restaurant</title>
        <link href="style.css" rel="stylesheet" type="text/css" />     
    </head>
    <body>
        <center>
            <c:set var="session" value="${sessionScope.user}"/>
            <c:if test="${empty session}">
                <script>
                    function h()
                    {
                        window.location="index.jsp"
                    }
                </script>
            </c:if>
            <div class="outer">
                <!--Header end-->
                <div id="rc1"></div>
                <div id="bg">
                    <div class="toplinks"><a href="ContactUs.jsp">Contact us</a></div><div class="sap">|</div>
                    <div class="toplinks"><a href="initShowFood?action=Food">Food</a></div><div class="sap">|</div>
                    <div class="toplinks"><a href="ControllerTables?action=Table">Table</a></div><div class="sap">|</div>
                    <div class="toplinks"><a href="ControllerRooms?action=Room">Room</a></div><div class="sap">|</div>
                    <c:if test="${empty session}">
                        <div class="toplinks"><a href="registration.jsp">Register</a></div><div class="sap">|</div>
                        <div class="toplinks"><a href="login.jsp">Login</a></div><div class="sap">|</div>
                    </c:if>
                    <div class="toplinks"><a href="index.jsp">Home Page</a></div>
                    <div><font color="white">Welcome, </font><font color="yellow">${sessionScope.user}</font> </div>
                    <div>
                        <font color="yellow"><a href="ControllerCustomer?action=Information&user=${sessionScope.user}">Your information</a></font>
                        <%
                                    if (session.getAttribute("isadmin") != null) {
                        %>
                        <a href="index_admin.jsp">Admin Manager</a>
                        <%                                    }
                        %>
                        <font color="yellow">
                            <c:url var="LogOut" value="ControllerCustomer">
                                <c:param name="action" value="LogOut"/>
                            </c:url>
                            <a href="${LogOut}">LogOut</a>
                        </font>
                    </div>
                </div>
                <div id="rc2"></div>
                <div id="header">
                    <div class="name">Tunga Restaurant</div>
                    <div class="tag">The best restaurant in the world</div>
                </div>
                <!--Top nav end-->
                <div style="clear:left"></div>
                <div id="outer2">
                    <div id="left-nav">
                        <div class="leftlinks">
                            <span class="heading">Quick Links</span>
                            <ul>
                                <li><a href="index.jsp">Home Page </a></li>
                                <li><a href="ControllerRooms?action=Room">Room</a></li>
                                <li><a href="ControllerTables?action=Table">Table</a></li>
                                <li><a href="initShowFood?action=Food">Food</a></li>
                                <c:if test="${not empty session}">
                                    <li><a href="ControllerRooms?action=BookRoom">Book Room</a></li>
                                    <li><a href="ControllerTables?action=BookTable">Book Table </a></li>                                    
                                    <li><a href="addToCart.jsp">Shopping Cart</a></li>
                                </c:if>
                                <li><a href="ContactUs.jsp">Contact Us </a></li>
                            </ul>
                        </div>
                    </div><div class="inner_copy"><div class="inner_copy">All <a href="http://www.magentothemesworld.com" title="Best Magento Templates">premium Magento themes</a> at Magentothemesworld.com!</div></div>
                    <div id="content">
                        <span class="heading">Food </span><br>
                        <span class="heading"><a href="initShowFood?action=Vegetable&CaFoodID=1">Vegetable</a>|<a href="initShowFood?action=Vegetable&CaFoodID=2">Non-Vegetable</a></span>
                        <div id="main">
                            <c:set var="all" value="${applicationScope.listFood}"/>
                            <c:set var="count" value="0"/>
                            <c:if test="${not empty all}">
                                <table border="0" id="myTable" class="tablesorter">
                                    <thead>
                                        <tr>
                                            <th></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <c:forEach var="rows" items="${all}">
                                        <input type="hidden" name="user" value="${sessionScope.user}"/>
                                        <tr>
                                            <td>
                                                <br/>
                                                <img src="${rows.picture}"/>
                                                Food Name: ${rows.foodName}<br>Price: $ ${rows.price}<br>
                                                <c:if test="${not empty session}">
                                                    <a href="ControllerFood?action=AddToCart&id=${rows.foodID}">Add To Cart</a>
                                                </c:if>&nbsp;&nbsp;  <a href="ControllerFood?action=DetailFood&FoodID=${rows.foodID}">Detail</a>
                                            </td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>                               
                                <div id="pager" align="center">
                                    <form>
                                        <input type="button" value="<<" class="first"/>
                                        <input type="button" value="<" class="prev"/>
                                        <input type="text"  class="pagedisplay"/>
                                        <input type="button" value=">" class="next"/>
                                        <input type="button" value=">>" class="last"/>
                                        <select class="pagesize">
                                            <option selected="selected" value="5">5</option>
                                            <option value="10">10</option>                           
                                        </select>
                                    </form>
                                </div>
                            </c:if>
                        </div>
                    </div>
                    <div style="clear:left"></div>
                </div>
                <!--Bottom part-->
                <div id="bottom">
                    <div id="footer"><div class="fcenter">GROUP02-F5-10-1009-S1</div></div>
                </div>
            </div>
        </center>
    </body>
</html>
<script type="text/javascript">
    jQuery(document).ready(function(){
        $("#myTable")
        .tablesorter({widgets:['zebra']})
        .tablesorterPager({container:$("#pager"),size:5});
        //.tablesorterFilter({filterContainer:$("#filter-box"),
        //     filterClearContainer:("#filter-clear-button"),
        //    filterColumns:[0],
        //     filterCaseSensitive:false });

    });
</script>